///////////////////////////////////////////////////////////
//  NewTemplateCommand.cpp
//  Implementation of the Class NewTemplateCommand
//  Created on:      21-Sep-2013 12:08:24 PM
//  Original author: Jakkaphan Aiemcharoenjit
///////////////////////////////////////////////////////////

#include "NewTemplateCommand.h"
#include "CurrentCommand.h"

using namespace UI;
using namespace UI::CMD;

NewTemplateCommand::NewTemplateCommand(CCreateTemplateView* createTemplate, CTemplateView* _template)
{
  this->m_type = ICommand::NEWTEMPLATE_CMD;
  this->m_createTemplateView = createTemplate;
  this->m_templateView = _template;
}


NewTemplateCommand::~NewTemplateCommand()
{

}


void NewTemplateCommand::Execute()
{
  this->m_createTemplateView->SetTitleView("New template");
  this->m_createTemplateView->NewPage();
  this->m_createTemplateView->Refresh();
  // Set current command
  CurrentCommand::GetInstance()->SetCurrentCommand(this->m_type);
  CurrentCommand::GetInstance()->SetNewOrEditCommand(this->m_type);
}


ICommand::CommandType NewTemplateCommand::GetType()
{
	return this->m_type;
}